﻿using Microsoft.AspNetCore.Mvc;

namespace PageOffice6_Net_Core.Controllers.ExcelDisableRight
{
    public class ExcelDisableRightController : Controller
    {

        public IActionResult Excel()
        {
            PageOfficeNetCore.PageOfficeCtrl poCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);

            PageOfficeNetCore.Excel.WorkbookWriter workBook = new PageOfficeNetCore.Excel.WorkbookWriter();
            workBook.DisableSheetRightClick = true;//禁止当前工作表的鼠标右键                                                   
            //workBook.DisableSheetDoubleClick = true;//禁止当前工作表的鼠标双击
            poCtrl.SetWriter(workBook);

            poCtrl.WebOpen("doc/test.xls", PageOfficeNetCore.OpenModeType.xlsNormalEdit, "tom");
            ViewBag.poCtrl = poCtrl.GetHtml();
            return View();
        }

    }
}